<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* html{
            scroll-behavior: smooth;
        } */
        *{
            padding: 0;
            margin: 0;
        }
        .box{
            position: fixed;
            bottom: 50px;
            left: 50px;
            width: 50px;
            height: 50px;
            background-color: pink;
        }
        body{
            height: 4000px;
        }
    </style>
</head>
<body>
    <div class="box"></div>

    <script>
        var box = document.querySelector('.box');
        box.onclick = function () {
            window.scrollBy({
                top: -500,
                behavior: 'smooth'
            })
            // window.scroll(0, 200)
        }
    </script>
</body>
</html>